package com.yidong.laidian.laidian.exception;

import com.yidong.laidian.laidian.enums.ResultEnum;

import java.io.Serial;

public class ApiViewException extends RuntimeException{
    @Serial
    private static final long serialVersionUID = 224207019919827046L;

    private int code;

    public ApiViewException(ResultEnum resultEnum){
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

    public ApiViewException(int code,String message) {
        super(message);
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
